#ifndef _EKEKO_H_
#define _EKEKO_H_

#include <Eina.h>
#include <Eix.h>
#include <Enesim.h>

#ifdef EAPI
# undef EAPI
#endif

#ifdef _WIN32
# ifdef EKEKO_BUILD
#  ifdef DLL_EXPORT
#   define EAPI __declspec(dllexport)
#  else
#   define EAPI
#  endif /* ! DLL_EXPORT */
# else
#  define EAPI __declspec(dllimport)
# endif /* ! EKEKO_BUILD */
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif

EAPI void ekeko_init(void);
EAPI void ekeko_shutdown(void);
EAPI Eina_Bool ekeko_ecore_loopize(void);
EAPI void ekeko_ecore_unloopize(void);
EAPI Eina_Bool ekeko_is_connected(void);

/* TODO possible API on the lib side */
typedef struct _Ekeko_Context Ekeko_Context;

EAPI Ekeko_Context * ekeko_context_new(const char *name, uint32_t max_size);
EAPI const char * ekeko_context_name_get(Ekeko_Context *thiz);
EAPI uint32_t ekeko_context_size_get(Ekeko_Context *thiz);
EAPI void ekeko_context_free(Ekeko_Context *thiz);

typedef void (*Ekeko_Image_Loaded_Cb)(Enesim_Surface *s, Eix_Error *err,
		void *user_data);

EAPI void ekeko_image_load(Ekeko_Context *ctx, const char *file, Enesim_Surface **s,
		Eix_Error *err);
EAPI void ekeko_image_load_async(Ekeko_Context *ctx, const char *file,
		Ekeko_Image_Loaded_Cb cb, const void *data);

#endif
